let app = new Vue({
    el: "#accordion",
    data: {
        leftData: [
            {
                'title': '社区管理',
                'list': [
                    {
                        'name': '帖子审核',
                        'link': '/admin/review.html'
                    },
                    {
                        'name': '黑名单',
                        'link': '/admin/baned.html'
                    }
                ]
            }
            // ,{
            // 'title':'审核记录',
            // 'list':[
            //     {
            //         'name':'审核通过',
            //         'link':'#'
            //     },
            //     {
            //         'name':'黑名单',
            //         'link':'/admin/banded.html'
            //     }
            // ]
            // }
        ]
    }
});

let review = new Vue({
    el: "#review",
    data: {
        reviewArticleList: []
    },
    methods: {
        pass: reviewArticle => {
            $.post("/admin/reviewArticle/pass", {reviewId: reviewArticle.reviewId}, result => {
                review.removeArticle(reviewArticle)
            })
        },
        deleteA: reviewArticle => $.post("/admin/reviewArticle/delete", {reviewId: reviewArticle.reviewId}, result => review.removeArticle(reviewArticle)),
        removeArticle: reviewArticle => review.reviewArticleList.splice(review.reviewArticleList.indexOf(reviewArticle), 1)
    }
});

let baned = new Vue({
    el: "#baned",
    data: {
        banedUserList: []
    },
    methods: {
        // pass: reviewArticle => $.post("/admin/reviewArticle/pass", {reviewId: reviewArticle.reviewId},
        //     result=>review.reviewArticleList.splice(review.reviewArticleList.indexOf(reviewArticle),1)),
        // deleteA:(reviewArticle) =>$.post("/admin/reviewArticle/delete", {reviewId: reviewArticle.reviewId},
        //     result=>review.reviewArticleList.splice(review.reviewArticleList.indexOf(reviewArticle),1))
    }
});
